import Axios from 'axios'

export default {
	/**
	 * @description 获取标签列表
	 */
	tags: data => {
		return Axios.get('/tags', { params: data })
	},
	/**
	 * @description 新建标签
	 */
	newTags: params => {
		return Axios.post('/tags', params)
	},
	/**
	 * @description 发送修改标签请求
	 */
	editTagsRequest: params => {
		return Axios.put('/tags', params)
	},
	/**
	 * @description 发送删除标签请求
	 */
	deleteTags: id => {
		return Axios.delete('/tags/' + id).then(res => res.data)
	},
	/**
	 * @description 标签状态
	 */
	tagsIdState: (id, state) => {
		return Axios.post('/tags/' + id + '/' + state)
	},
	/**
	 * 标签简单列表
	 */
	tagsSimple: ({ subjectID, tagName }) => {
		return Axios.get('/tags/simple', {
			params: {
				subjectID,
				tagName
			}
		}).then(res => res.data)
	}
}
